{% extends 'TopxiaWebBundle:User:layout.html.twig' %}

{% block title %}{{ parent() }}{% endblock %}

{% set pageNav = 'friend' %}

{% block main %}


<ul class="nav nav-pills mbl">
  <li {% if friendNav == 'following' %}class="active"{% endif %}><a href="{{ path('user_following', {id:user.id}) }}">关注</a></li>
  <li {% if friendNav == 'follower' %}class="active"{% endif %}><a href="{{ path('user_follower', {id:user.id}) }}">粉丝</a></li>
</ul>

<div class="row">
  {% for friend in friends %}
  <div class="col-md-4">
    <div class="friendcard clearfix">
      <a href="{{ path('user_show', {id:friend.id}) }}"><img src="{{ filepath(friend.mediumAvatar, 'avatar.png')  }}" class="avatar"></a>
      <div class="infos">
        <a href="{{ path('user_show', {id:friend.id}) }}" class="nickname">{{ friend.nickname }}</a>
        <div class="title">{{ friend.title }}</div>
      </div>
    </div>
  </div>
  {% else %}
    {% if friendNav == 'following' %}
      <div class="empty">无关注的人</div>
    {% elseif friendNav == 'follower' %}
      <div class="empty">无粉丝</div>
    {% endif %}
  {% endfor %}
</div>


{% endblock %}